package com.wing.wcabinet.model.entity;

import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 上货数量
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("wcab_cell_load")
public class WcabCellLoad extends BaseEntity<WcabCellLoad> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum Type implements IEnum<Integer> {


        /**
         * 补货上货
         */
        replenishment(0,"补货上货"),
        /**
         * 自主上货
         */
        selfLoad(1,"自主上货"),
        selfLoadSimple(2,"自主上货"),
        selfUnloadSimple(3,"自主下货"),
        selfBatchLoadSimple(4,"自主上货"),
        selfBatchUnloadSimple(5,"自主下货"),
        returnToCab(6,"退货");
        private int code;
        private String desc;

        Type(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    public enum OperationType implements IEnum<Integer> {

        /**
        * 上货
        */
        load(1,"上货"),
        /**
        * 下货
        */
        unload(2,"下货"),
        /**
        * 补货
        */
        supplyIn(4,"补货"),
        /**
        * 退货
        */
        returnIn(5,"退货");

        private int code;
        private String desc;

        OperationType(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 领货单id
     */
    private Long receiveId;

    /**
     * 类型
     */
    private Type type;

    /**
    * 类型描述
    */
    @TableField(exist = false)
    private String typeDesc;

    public String getTypeDesc() {
        return type == null ? null : type.getDesc();
    }

    /**
     * 上货单号
     */
    private String code;

    /**
     * day
     */
    private Integer day;

    /**
     * no
     */
    private Integer no;

    /**
     * 操作类型
     */
    private OperationType operationType;

    /**
    * 操作类型描述
    */
    @TableField(exist = false)
    private String operationTypeDesc;

    public String getOperationTypeDesc() {
        return operationType == null ? null : operationType.getDesc();
    }


    private String cabCode;

    private String deviceCode;

    private String departmentName;

    private String roleName;

    private String enterpriseCode;

}
